1. Field of the Invention
The present invention relates to a numerical controller that controls machine tools, and more particularly to a numerical controller having a program restart function.
2. Description of the Related Art
A program restart function of acquiring data of a non-cutting command block as program restart block data for resuming a suspended machining process of a workpiece is disclosed, for example, in Japanese Patent Application Laid-open No. 2009-53801.
This program restart block data contains information required for resuming the program such as a number of a block of the currently executed machining program, start and end positions of the currently executed block, various pieces of modal information of the currently executed block, a number of a main program and a subprogram call block position, and a total number of blocks from the main program to the currently executed block.
Non-cutting commands include, aside from a program restart block data acquisition code pre-registered as a non-cutting command for acquisition of the program restart block data, rapid traverse commands, auxiliary function commands, commands for moving a pre-registered controlled axis, tool position correction commands, dwell commands, spindle stop commands, spindle rotation commands, and subprogram call commands.
However, to decide in which portion of the machining object the machining needs to be resumed from the drawing, it takes a large number of steps to determine through examination which of the non-cutting command blocks is the command desired to be executed, and this can be a factor for occurrence of human errors.
Japanese Patent Application Laid-open No. 9-160620 discloses an example of a solution to this problem. According to the disclosure, command data is stored, a machining area is selected, and the command data is examined with respect to the machining area. If the command data involves commands to be executed within the machining area, the commands of this command data are executed. If the command data involves commands executed outside the machining area, the commands of this command data are not executed. Next, it is determined whether or not an axial movement instructed by the command data is a movement from outside into the machining area, and if the axial movement is determined to be as such, an intersection between the axial movement path and a boundary of the machining area, or a point in the vicinity, is determined, and this intersection or point is set as the start point for resuming the program.
With this method, however, there is no means of verifying programs neighboring the start block before resuming the program, because of which there is a risk that the operator may execute the program from a different block from the intended one. Moreover, since no block is set as the end block of the resumed program, if the machining program involves a series of processes using a plurality of machine tools and is repeated over and over in the specified machining area, there is a risk that the machining may be executed beyond an intended area of the machining program.
Another solution is shown in Japanese Patent Application Laid-open No. 2007-226648, wherein an execution start position for starting execution of a machining program and an execution end position for ending the execution are stored, and the program is executed only from the command corresponding to the execution start position to the command corresponding to the execution end position.
With this method, however, an execution start position and an execution end position are uniquely defined, i.e., the execution start position or the execution end position cannot be freely selected from a plurality of blocks instructing a tool to move in a path that intersects with a boundary of a given machining area, or their neighboring blocks.